export const optionConfig = (interruptY1, interruptY2, interruptY3, interruptX, interruptY4) => {
    return {
        // backgroundColor: '#0E2A43',
        // title: {
        //     text: "使用多个x轴--重叠",
        //     left: "center",
        //     top:"10",
        //     textStyle: {
        //         color: '#0fa9ee',
        //         fontSize: 24,
        //     }
        // },
        tooltip: {
            trigger: "axis",
            axisPointer: {
              // 坐标轴指示器，坐标轴触发有效
              type: "shadow", // 默认为直线，可选为：'line' | 'shadow'
            },
          },
        legend: {
            orient: "horizontal",
            itemWidth: 10,
            itemHeight: 10,
            data: [
                {
                    name: "QA Procedures",
                    icon: "circle"
                }, {
                    name: "MVCT Procedures",
                    icon: "circle"
                }, {
                    name: "Tx Procedures",
                    icon: "circle"
                }, {
                    name: "Patient QA Procedures",
                    icon: "circle"
                }
            ],
            left: 0,
            top: "1%",
            textStyle: {
                color: "#DFDFDF",
                fontSize: 10
            }
        },
        grid: {
            left: "3%",
            right: "4%",
            bottom: "3%",
            top: '5%',
            containLabel: true
        },
        xAxis: [{
            axisTick: {
                show: false
            },
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#fff',
                }
            },
            axisLabel: {
                formatter: function (value) {
                    const monthN = new Date(value).getMonth()
                    const day = new Date(value).getDate()
                    const month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Junl', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
                    return month[monthN] + '' + day;
                }
            },
            data: interruptX
        }, {
            show: false,
            data: interruptX
        }, {
            show: false,
            data: interruptX
        }, {
            show: false,
            data: interruptX
        }],

        yAxis: {
            name: '单位/次数',
            nameTextStyle: {
                color: '#FFF',
                fontSize: 10
            },
            type: 'value',
            axisTick: {
                show: false
            },
            axisLine: {
                show: false,
                lineStyle: {
                    color: '#fff',
                }
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#aaa',
                }
            },
        },
        series: [
            {
                type: "bar",
                name: 'QA Procedures',
                barWidth: 5,
                xAxisIndex: 2,
                itemStyle: {
                    barBorderRadius: [10, 10, 0, 0],
                    color: '#F3BC44'
                },
                // zlevel: 2,
                data: interruptY1,
            },
            {
                type: "bar",
                name: 'MVCT Procedures',
                barWidth: 5,
                data: interruptY2,
                itemStyle: {
                    barBorderRadius: [10, 10, 0, 0],
                    color: '#FF2878'
                },
            }, {
                type: "bar",
                name: 'Tx Procedures',
                xAxisIndex: 1,
                barWidth: 5,
                itemStyle: {
                    barBorderRadius: [10, 10, 0, 0],
                    color: '#42F3FF'
                },
                data: interruptY3,
            }, {
                type: "bar",
                name: 'Patient QA Procedures',
                xAxisIndex: 3,
                barWidth: 5,
                itemStyle: {
                    barBorderRadius: [10, 10, 0, 0],
                    color: '#EA6E28'
                },
                data: interruptY4,
            }]
    };
}

